package com.boot.rabbitmq.service;

import com.alibaba.fastjson.JSON;
import com.boot.customer.pojo.Customer;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

@Service
public class RabbitmqService {

    @RabbitListener(queues = "test.direct")
    public void receive(Customer customer) {
        System.err.println("收到消息：" + JSON.toJSONString(customer));
    }
}
